def func(val):
    def inner(a1, a2):
        return val + a1 + a2

    return inner


data_list = []

for i in range(10):
    data_list.append(func(i))
    for j in data_list:
        result = j(1, 2)
        print(result)

print(data_list)

# # 假设我们想要对每个inner函数调用相同的参数a1=1和a2=2
# results = [f(1, 2) for f in data_list]
# print(results)
